What Should We Write First?
Now we have our simple pseudocode:
days = 0 while date1 is before date2: date1 = day after date1 days += 1 return days
What should we write first?
daysBetweenDates to solve the whole problem
daysBetweenDates
nextDay(year,month,day) to get next day for simple case
nextDay(year,month,day)
isLeapYear(year) to determine if year is leap year
isLeapYear(year)
daysInMonth(month) to get the number of days in a month
daysInMonth(month)